<template>
  <div>
    <div>
      <span class="padding-l-sm">
        {{ customerName }} <img v-if="icon" :src="icon" style="height:12px" />
      </span>
    </div>
    <div>
      <span class="padding-l-sm">
        {{ customerTargetPrice }}
      </span>
    </div>
  </div>
</template>

<script>
import vipPng from "@/assets/images/vip_icon.png";
import svipPng from "@/assets/images/svip_icon.png";

export default {
  props: ["row", "data", "more"],
  data() {
    return {
      icon: "",
      customerName: "",
      customerTargetPrice: "",
      levelMap: {}
    };
  },
  mounted() {
    this.initShow();
  },
  methods: {
    initShow() {
      this.customerName = this.data["customerName"];
      this.customerTargetPrice = this.data["customerTargetPrice"];
      this.levelMap = this.$store.state.main.entry.sources[
        "customerLevelReverseSource"
      ];
      console.log(this.levelMap);
      var level = this.levelMap[this.customerName];
      if (level) {
        if (level == 10) {
          this.icon = svipPng;
        } else if (level == 20) {
          this.icon = vipPng;
        }
      }
    }
  }
};
</script>
